<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" href="../plugins/layui/css/layui.css" media="all" />
		<link rel="stylesheet" href="../css/global.css" media="all">
		<link rel="stylesheet" href="../plugins/font-awesome/css/font-awesome.min.css">
		<link rel="stylesheet" href="../css/table.css" />
	</head>

	<body>
		<div class="admin-main">
			<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
				<legend>模板预览</legend>
				<div class="layui-field-box">
					<table class="site-table table-hover">
						<thead class="jqHead">
							<tr>
								
							</tr>
						</thead>
						<tbody class="jqList">
							
						</tbody>
					</table>

				</div>
			</fieldset>
		</div>
		<script type="text/javascript" src="../plugins/layui/layui.js"></script>
		<script>
			layui.config({
				base: '../plugins/layui/modules/'
			});

			layui.use(['icheck', 'laypage', 'layer', 'form', 'layedit', 'laydate'], function() {
				var $ = layui.jquery,
					laypage = layui.laypage,
					layer = parent.layer === undefined ? layui.layer : parent.layer;
				
				window.loadExcelData = function(sheet){
			      	if(sheet.length>0){
			      		var test = sheet[0];
			      		
			      		var fields = [];
			      		for(var key in test){
			      			fields.push("<th>"+key+"</th>");
			      		}
			      		
			      		var values = [];
			      		for(var i=0,l=sheet.length;i<l;i++){
			      			var td = [];
			      			for(var k in sheet[i]){
			      				td.push("<td>"+sheet[i][k]+"</td>");
			      			}
			      			values.push("<tr>"+td.join('')+"</tr>");
			      		}
			      		
			      		$(".jqHead").empty().append(fields.join(''));
			      		$(".jqList").empty().append(values.join(''));
			      	}
				}
			});
		</script>
	</body>

</html>